﻿using House.IService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace House.Admin.Controllers
{
    public class PermissionController : Controller
    {
        public IPermission PerMission { get; set; }
        public PermissionController(IPermission permission)
        {
            PerMission = permission;
        }
        // GET: Permission
        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult GetList(int start, int length, string name = "")
        {
            long rowCount = 0;
            var list = PerMission.GetList(start, length, name, ref rowCount);
            var result = new { data = list, recordsTotal = rowCount, recordsFiltered = rowCount };
            return Json(result);
        }

        public ActionResult Add()
        {
            return View();
        }
    }
}